#!/bin/bash

# Test disk error handling with full path name

. ./common

# make different size of devices
for i in `seq 0 2`; do
	_make_device $i    $((100 * 1024 ** 2))
	_make_device $i/d0 $((100 * 1024 ** 2))
	_make_device $i/d1 $((100 * 1024 ** 2))
done

for i in `seq 0 2`; do
	$SHEEP $STORE/$i/,$STORE/$i/d0/,$STORE/$i/d1/ -z $i -p $((7000+$i)) -c $DRIVER $SHEEP_OPTIONS
done

_wait_for_sheep 3

_cluster_format -c 2:1

_vdi_create test 99M

_random | $DOG vdi write test

$DOG vdi read test | md5sum > $STORE/csum.1

# remove obj directory to occut EIO
umount $STORE/0/d0
rm -rf $STORE/0/d0

$DOG vdi read test | md5sum > $STORE/csum.2

diff -u $STORE/csum.1 $STORE/csum.2
